package net.hn.hnms.sys.system.controller.feign;

import net.hn.hnms.sys.system.remote.RemoteDataScopeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * Author: PanSX
 * Date: 2022/7/13 11:01
 */
@ApiIgnore
@RestController
@RequestMapping("/remoteDataScope")
@Validated
public class RemoteDataScopeController {
    @Autowired
    RemoteDataScopeServiceImpl remoteDataScopeService;

    /**
     * 获取角色自定义权限语句
     *
     * @param roleId 角色Id
     * @return 角色权限
     */
    @GetMapping("/getRoleCustom")
//    @SaCheckLogin
    public String getRoleCustom(@RequestParam("roleId") Long roleId){
        return remoteDataScopeService.getRoleCustom(roleId);
    }

    /**
     * 获取部门和下级权限语句
     *
     * @param deptId 部门Id
     * @return 部门权限
     */
    @GetMapping("/getDeptAndChild")
//    @SaCheckLogin
    public String getDeptAndChild(@RequestParam("deptId") Long deptId){
        return remoteDataScopeService.getDeptAndChild(deptId);
    }

}
